<script>
$(document).ready(function(){
	
	var c = {
		submitok:function(){
			var opass	= get('oldpass_{rand}').value;
			var pass	= get('newpass_{rand}').value;
			var pass1	= get('newpass1_{rand}').value;
			
			if(opass==''){
				js.show.error('旧密码不能为空');
				return false;
			}

			if(pass.length <4){
				js.show.error('新密码不能少于4个字符');
				return false;
			}
			if(!/[a-zA-Z]{1,}/.test(pass) || !/[0-9]{1,}/.test(pass)){
				js.show.error('新密码必须使用字母+数字');
				return false;
			}

			if(pass!=pass1){
				js.show.error('确认密码不一致');
				return false;
			}
			
			js.ajax.post({
				url:'api/geren/editpass',
				loading:'修改中...',
				loadsuccess:'修改成功',
				data:{
					opass:opass,
					pass:pass
				}
			},function(){
				js.setoption('rockpass', pass);
			});
		}
	}
	js.initbtn(c);
});
</script>

<div align="center">
	<div style="padding:20px;margin-top:50px;max-width:330px" class="rock-panel rock-border rock-radius">
		<div class="blank10"></div>
		<div><input class="input" id="oldpass_{rand}" placeholder="旧密码" type="password" style="width:220px"></div>
		<div class="blank20"></div>
		<div><input class="input" id="newpass_{rand}" placeholder="新密码至少4位数字字母组合" type="password" style="width:220px"></div>
		
		<div class="blank20"></div>
		<div><input class="input" id="newpass1_{rand}" placeholder="确认密码" style="width:220px"></div>
		
		<div class="blank10"></div>
	</div>
	
	<div style="margin-top:30px"><input clickevt="submitok" style="width:150px" type="button" value="确定修改" class="webbtn webbtn-big"></div>
	
</div>